package com.lz.gmall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.gmall.product.entity.BaseCategory2;
import com.lz.gmall.product.service.BaseCategory2Service;
import com.lz.gmall.product.mapper.BaseCategory2Mapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class BaseCategory2ServiceImpl extends ServiceImpl<BaseCategory2Mapper, BaseCategory2>
    implements BaseCategory2Service{

    /**
     * 根据一级产品id获取二级产品
     * @param cate1Id 一级产品id
     * @return 二级产品集合
     */
    @Override
    public List<BaseCategory2> findAllByCate1Id(Long cate1Id) {
        LambdaQueryWrapper<BaseCategory2> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BaseCategory2::getCategory1Id,cate1Id);

        List<BaseCategory2> list = this.list(wrapper);
        return list;
    }
}




